home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 19 / madtrb14.zip / STATS.DOC < prev    next >
Text File  |  1985-05-17  |  9KB  |  230 lines

  1. ==========================================================================
  2. =                            PIBSIGS.LBR                                 =
  3. ==========================================================================
  4.  
  5. Introduction:
  6. ------------
  7.  
  8. PIBSIGS.LBR contains Turbo Pascal procedures which
  9. compute a variety of statistical distribution functions.  The
  10. distributions include the Beta, Log Gamma, Incomplete Gamma, F, t,
  11. Chi-square, and Normal distributions.  Both the forward
  12. and inverse functions are provided.  Although specific routines for
  13. the binomial and negative binomial distribution are not given here,
  14. probabilities and percentage points for those two distributions
  15. can be computed from the Beta distribution.
  16.  
  17. Machine-dependent constants assume that Turbo-87 is to be used.
  18. All machine-dependent constants are located in module SIGCONST.PAS,
  19. if you wish to change them.  You will need to change them if you don't
  20. use Turbo-87.
  21.  
  22. I assume that you know something about these distributions, and when
  23. they should be used.  If you don't, these routines may not be very
  24. useful to you.  If you'd like to learn more about the subject of
  25. statistical distributions, I suggest you read the series of books
  26. by Johnson and Kotz, covering both discrete and continuous
  27. statistical distributions.  The publisher is Houghton Mifflin.
  28.  
  29.  
  30. Files:
  31. -----
  32.  
  33. Library PIBSIGS.LBR contains the following files:
  34.  
  35.      README.DOC   --- what you are reading now.
  36.  
  37. --- Basic distribution and support routines
  38.  
  39.      ALGAMA.PAS   --- logarithm of gamma function
  40.      CDBETA.PAS   --- cumulative Beta distribution
  41.      CDNORM.PAS   --- cumulative normal distribution
  42.      ERF.PAS      --- Gaussian error function
  43.      GAMMAIN.PAS  --- incomplete gamma integral
  44.      LOGTEN.PAS   --- base 10 logarithm
  45.      POWER.PAS    --- raise number to a real power
  46.      POWERI.PAS   --- raise number to an integer power
  47.      POWTEN.PAS   --- computes powers of ten
  48.      SIGCONST.PAS --- machine dependent constants
  49.  
  50. --- Point probability routines
  51.  
  52.      SIGCHI.PAS   --- significance of chi-square
  53.      SIGF.PAS     --- significance of F
  54.      SIGNORM.PAS  --- significance of normal value
  55.      SIGT.PAS     --- significance of t
  56.  
  57. --- Inverse distributions (percentage points)
  58.  
  59.      BETINV.PAS   --- Inverse Beta
  60.      CINV.PAS     --- Inverse chi-square
  61.      FINV.PAS     --- inverse F
  62.      NINV.PAS     --- inverse normal (low accuracy)
  63.      NINV2.PAS    --- inverse normal (high accuracy)
  64.      TINV.PAS     --- inverse t
  65.  
  66. --- Demonstration routines
  67.  
  68.      TESTINVC.PAS --- demonstrate inverse chi-square
  69.      TESTINVF.PAS --- demonstrate inverse F
  70.      TESTINVN.PAS --- demonstrate inverse normal
  71.      TESTINVT.PAS --- demonstrate inverse t
  72.      TESTSIGC.PAS --- demonstrate chi-square significance
  73.      TESTSIGF.PAS --- demonstrate F significance
  74.      TESTSIGN.PAS --- demonstrate normal probability
  75.      TESTSIGT.PAS --- demonstrate t significance
  76.  
  77. --- File containing "(*$I" include directives for all the distribution
  78.     routines:
  79.  
  80.      SIGALL.PAS
  81.  
  82. All of the Pascal source modules (ending in .PAS) are squeezed, so that
  83. they actually appear as *.PQS in the PIBSIGS.LBR library file.
  84. For instance, SIGF.PAS appears under the name SIGF.PQS.  The Pascal
  85. routines were squeezed WITHOUT the time and date stamp, so your favorite
  86. unsqueezer should have no difficulty.  I especially recommend
  87. Alan Losoff's ALUSQ.COM.
  88.  
  89.  
  90. Credits:
  91. -------
  92.  
  93. These routines are translations of Fortran and Assembler routines which I
  94. have used in various programs for many years.  Many of the algorithms
  95. are modified from ones which appeared in Applied Statistics or the
  96. Communications of the ACM algorithms sections.  If the algorithm comes from
  97. one of those sources, that is mentioned in the header comments for the
  98. corresponding routine.
  99.  
  100. I chose the algorithms included here based upon extensive experience and
  101. empirical, simulation, and theoretical studies that demonstrate these
  102. to be among the best available in terms of speed, accuracy, and robustness.
  103. However, the area of computing for statistical distributions is
  104. a constantly changing one, and any of the methods included here may soon
  105. be retired in favor of new and better ones.
  106.  
  107.  
  108. What PIBSIGS does:
  109. ------------------
  110.  
  111. PIBSIGS provides a fairly complete library of statistical distribution
  112. routines covering the three most commonly used families of distributions:
  113. the Incomplete Beta (F, t, binomial); the Incomplete Gamma (Chi-square);
  114. and the Normal.  These three distributions can also be used to approximate
  115. many other families.
  116.  
  117. These routines may be used to compute the observed probabilities of
  118. hypothesis tests and to compute percentage points required for the
  119. construction of confidence intervals.
  120.  
  121. The basic routines for the beta and gamma distributions allow you to
  122. specify the degree of accuracy you want and the maximum number of
  123. iterations allowed.  These routines also return an accuracy indicator
  124. showing how many digits of precision were actually calculated.  Note that
  125. this doesn't mean that the answers are correct to that many places,
  126. just that two successive ietratively derived values match to as many
  127. decimal places as indicated.
  128.  
  129. The programs beginning with TEST... are brief demonstrations of how to
  130. use the lower-level routines.  The test programs typically ask for
  131. a test value or probability value, and degrees of freedom.  The output is
  132. either the corresponding probability or percentage point.
  133.  
  134.  
  135. Using PIBSIGS:
  136. --------------
  137.  
  138. Extract all the .PQS files from the library.  For most library utilities
  139. this request appears as follows:
  140.  
  141.     LU A PIBSIGS.LBR
  142.         or
  143.     LU86 -A PIBSIGS.LBR
  144.  
  145. After extracting all the files, unsqueeze all of the .PQS files.
  146. Using an unsqueezer like Losoff's ALUSQ, this can be done as
  147. follows:
  148.  
  149.     ALUSQ *.PQS
  150.  
  151. If your unsqueezer doesn't allow wildcards, you will have to unsqueeze
  152. each file one at a time.
  153.  
  154. To use the routines in your program, include the following routines
  155. in this order before any others from PIBSIGS:
  156.  
  157.      SIGCONST.PAS
  158.      LOGTEN.PAS
  159.      POWER.PAS
  160.      POWERI.PAS
  161.      POWTEN.PAS
  162.      ALGAMA.PAS
  163.      ERF.PAS
  164.  
  165. Then write includes for the specific routines you want. The sample programs
  166. TEST*.PAS show which modules need to be included to use a given distribution.
  167.  
  168. To get ALL of the PIBSIGS modules included, copy the file SIGALL.PAS into your
  169. program.  SIGALL.PAS contains include directives for all the PIBSIGS modules
  170. (except the test program, of course).  Note that you can't include SIGALL.PAS
  171. using a "(*$I" directive, since Turbo Pascal doesn't allow nested includes.
  172.  
  173.  
  174. Glitches:
  175. --------
  176.  
  177. These routines are designed to work with TURBO-87, the 8087 version
  178. of Turbo Pascal. You must alter the constants in SIGCONST.PAS for the
  179. non-8087 version. I have NOT tested the routines without the 8087.
  180. I'd appreciate some feedback on how well they perform.
  181.  
  182. I hope that there are no coding errors in the routines; if you find
  183. any, please let me know ASAP as indicated below.
  184.  
  185. I'd also appreciate any feedback on the performance of these routines,
  186. or suggestions for alternate algorithms that you have found to be
  187. valuable -- especially algorithms for troublesome cases where the
  188. algorithms presented here have difficulties.   In particular, it would
  189. be nice to have algorithms that perform accurately and efficiently
  190. to approximate the Incomplete Beta distribution with large degrees
  191. of freedom -- greater than 100000.  Such degrees of freedom DO occur
  192. quite often in approximating multivariate distributions (e.g.,
  193. Box's M test for assessing homogeneity of covariance matrices).
  194.  
  195.  
  196. Usage Restrictions
  197. ------------------
  198.  
  199. I've placed these routines in the public domain.  You are free to
  200. add to them, correct them, extend them, or do whatever else you wish,
  201. but PLEASE do NOT sell them as your own work.  That's not nice.
  202. If you wish to use these in a commercial product, PLEASE let me know
  203. that you intend to do so (see below) so that I can inform you of
  204. any needed bug fixes.  You may use these routines in commercial
  205. programs AS LONG AS you mention that I wrote them and you DO NOT
  206. INCREASE THE PROGRAM'S PRICE JUST BECAUSE THESE ROUTINES ARE INCLUDED.
  207.  
  208.  
  209. Comments:
  210. --------
  211.  
  212. Send comments, suggestions, etc. to PHILIP BURNS on either of the
  213. following two Chicago BBSs:
  214.  
  215.        Gene Plantz's BBS:      (312) 882 4227
  216.        Ron Fox's BBS:          (312) 940 6496
  217.  
  218. or on the SMUG BBS:
  219.  
  220.        SMUG BBS (P. Olympia):  (301) 963 5249
  221.  
  222. As time permits, I will be adding other statistical distribution
  223. functions to these such as approximations for multivariate
  224. distributions, non-central distributions, and so on.  Your comments
  225. and suggestions are most welcome.
  226.  
  227.  
  228. Thanks,
  229. Phil Burns
  230. May, 1985